﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="range_clause_set.aspx.cs" Inherits="Ccit.UserControls.range_clause_set" %>
<html>
<head runat="server">
    <title>无标题页</title>
    <script src="../script/jquery.js" type="text/javascript"></script>
    <script src="../script/StringClass_Ext.js" type="text/javascript"></script>
    <script src="../script/jcontrol.js" type="text/javascript"></script>
    <script src="../script/jsonlib.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
        function doFilterUser() {
            var msRangeClause = {};
            getDeptClause(msRangeClause);
            getPosClause(msRangeClause);
            getClsClause(msRangeClause);

            var jsonExpr = JSON.stringify(msRangeClause, function(key, value) { return value; });
            parent.frames[1].getUserByClause(jsonExpr);
            msRangeClause = null;
        }

        function getDeptClause(msRangeClause) {            
            var isContainSub = ($get("chkSubDept").checked) ? "1" : "0";
            var isALL = ($get("chkAllDept").checked) ? "1" : "0";
            var nonDept = ($get("chkEmptyDept").checked) ? "1" : "0";

            var ctrlLstbDept = new ListBox("selDept");
            var selDeptIds = ctrlLstbDept.multiSelValue;

            var msDeptClause = {};
            msDeptClause.isContainSub = isContainSub;
            msDeptClause.isALL = isALL;
            msDeptClause.nonDept = nonDept;
            msDeptClause.selDeptIds = selDeptIds;

            msRangeClause.deptClause = msDeptClause;
            ctrlLstbDept = null;
        }

        function getPosClause(msRangeClause) {
            var isALL = ($get("chkAllPos").checked) ? "1" : "0";
            var nonPos = ($get("chkEmptyPos").checked) ? "1" : "0";

            var ctrlLstbPos = new ListBox("selPos");
            var selPosIds = ctrlLstbPos.multiSelValue;

            var msPosClause = {};
            msPosClause.isALL = isALL;
            msPosClause.nonPos = nonPos;
            msPosClause.selPosIds = selPosIds;

            msRangeClause.posClause = msPosClause;
            ctrlLstbPos = null;           
        }

        function getClsClause(msRangeClause) {            
            var isALL = ($get("chkAllClass").checked) ? "1" : "0";
            var nonCls = ($get("chkEmptyClass").checked) ? "1" : "0";

            var ctrlLstbCls = new ListBox("selClass");
            var selClsIds = ctrlLstbCls.multiSelValue;

            var msClsClause = {};
            msClsClause.isALL = isALL;
            msClsClause.nonCls = nonCls;
            msClsClause.selClsIds = selClsIds;

            msRangeClause.clsClause = msClsClause;
            ctrlLstbCls = null;           
        }
        
        function doClickClauseType(pType) {
            switch(pType) {
                case "1":
                     $get("trClauseDept").style.display = "block";
                     $get("trClausePos").style.display = "none";
                     $get("trClauseClass").style.display = "none";
                     //$get("trClauseWorkGroup").style.display = "none";
                    break;
                case "2":
                    $get("trClauseDept").style.display = "none";
                    $get("trClausePos").style.display = "block";
                    $get("trClauseClass").style.display = "none";
                    //$get("trClauseWorkGroup").style.display = "none";
                    break;
                case "3":
                    $get("trClauseDept").style.display = "none";
                    $get("trClausePos").style.display = "none";
                    $get("trClauseClass").style.display = "block";
                    //$get("trClauseWorkGroup").style.display = "none";
                    break;
                case "4":
                    $get("trClauseDept").style.display = "none";
                    $get("trClausePos").style.display = "none";
                    $get("trClauseClass").style.display = "none";
                    //$get("trClauseWorkGroup").style.display = "block";
                    break;
            }
        }
    //-->
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input type="hidden" id="_hidOrganId" runat="server" />
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr style="background-color:Aqua;height:25px">
                <td width="50%" align="left"><nobr><strong>&nbsp;人员过滤条件</strong></nobr></td>
                <td width="50%" align="right"><nobr>
                    <a href="javascript:doFilterUser()" class="linktext">
                        <img src="../images/toolbar/search.gif" border="0" />查找&nbsp;
                    </a>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <a href="javascript:doClickClauseType('1')">&nbsp;部门条件 >></a>
                </td>
            </tr>
            <tr id="trClauseDept">
                <td colspan="2">
                   <table cellpadding="0" cellspacing="0" width="100%">                                    
                        <tr>
                            <td>
                                <asp:ListBox ID="selDept" Width="98%" Height="180px" SelectionMode="Multiple" runat="server"></asp:ListBox>                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>
                                    <input type="checkbox" id="chkSubDept" class="checkbox" value="0" />包括下级子部门
                                    <input type="checkbox" id="chkAllDept" class="checkbox" value="1" />所有部门
                                    <input type="checkbox" id="chkEmptyDept" class="checkbox" value="2" />无部门                                    
                                </nobr>                                            
                            </td>
                        </tr>
                    </table>
                </td>   
            </tr> 
            <tr>
                <td colspan="2">
                    <a href="javascript:doClickClauseType('2')">&nbsp;职位条件 >></a>
                </td>
            </tr>
            <tr id="trClausePos">
                <td colspan="2">
                   <table cellpadding="0" cellspacing="0" width="100%">                                    
                        <tr>
                            <td>
                                <asp:ListBox ID="selPos" Width="98%" Height="180px" SelectionMode="Multiple" runat="server"></asp:ListBox>                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>
                                    <input type="checkbox" id="chkAllPos" class="checkbox" value="0" />所有职位
                                    <input type="checkbox" id="chkEmptyPos" class="checkbox" value="1" />无职位                                                                               
                                </nobr>
                            </td>
                        </tr>
                    </table>
                </td>   
            </tr> 
            <tr>
                <td colspan="2">
                    <a href="javascript:doClickClauseType('3')">&nbsp;级别条件 >></a>
                </td>
            </tr>
            <tr id="trClauseClass">
                <td colspan="2">
                   <table cellpadding="0" cellspacing="0" width="100%">                                    
                        <tr>
                            <td>
                                <asp:ListBox ID="selClass" Width="98%" Height="180px" SelectionMode="Multiple" runat="server"></asp:ListBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>
                                    <input type="checkbox" id="chkAllClass" class="checkbox" value="0" />所有级别
                                    <input type="checkbox" id="chkEmptyClass" class="checkbox" value="1" />无级别                                                                                     
                                </nobr>
                            </td>
                        </tr>
                    </table>
                </td>   
            </tr> 
            <!-- 先封掉workgroup
            <tr>
                <td colspan="2">
                    <a href="javascript:doClickClauseType('4')">&nbsp;工作组条件 >></a>
                </td>
            </tr>
            <tr id="trClauseWorkGroup">
                <td colspan="2">
                   <table cellpadding="0" cellspacing="0" width="100%">                                    
                        <tr>
                            <td>
                                <asp:ListBox ID="selWorkGroup" Width="98%" Height="180px" SelectionMode="Multiple" runat="server"></asp:ListBox>                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>
                                    <input type="checkbox" id="chkAllWorkGroup" class="checkbox" value="0" />所有工作组
                                    <input type="checkbox" id="chkEmptyWorkGroup" class="checkbox" value="1" />无工作组                                        
                                </nobr>
                            </td>
                        </tr>
                    </table>
                </td>   
            </tr> -->
        </table>   
    </form>
    <script type="text/javascript">
    <!--
        $(document).ready(function(){                        
            $get("trClauseDept").style.display = "block";
            $get("trClausePos").style.display = "none";
            $get("trClauseClass").style.display = "none";
            //$get("trClauseWorkGroup").style.display = "none";
        });
    //-->
    </script>
    </body>
</html>
